]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxpointer: Fix positioning with non-widget sources
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 1 Sep 2021 18:37:13 +0000 (20:37 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 1 Sep 2021 20:22:58 +0000 (20:22 +0000)
Commit 16d371873 lifted the requirement for source actors to be
widgets, then got it wrong :rolling_eyes:

The content box is expected to be in actor coordinates, so the
allocation must be translated to (0, 0).

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4593

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1969>

js/ui/boxpointer.js

index c7a8f92d019e0af324f40d8c18ae41af14a6ae16..be9c57ce03d83fb47e56915662d189086837a65c 100644 (file)
@@ -467,7 +467,10 @@ var BoxPointer = GObject.registerClass({
         const sourceAllocation = sourceActor.get_allocation_box();
         const sourceContentBox = sourceActor instanceof St.Widget
             ? sourceActor.get_theme_node().get_content_box(sourceAllocation)
-            : sourceAllocation;
+            : new Clutter.ActorBox({
+                x2: sourceAllocation.get_width(),
+                y2: sourceAllocation.get_height(),
+            });
         let sourceTopLeft = this._sourceExtents.get_top_left();
         let sourceBottomRight = this._sourceExtents.get_bottom_right();
         let sourceCenterX = sourceTopLeft.x + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;